{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "%matplotlib inline\n",
    "from pylab import * \n",
    "import skrf as rf\n",
    "rf.stylely()\n",
    "from skrf.media import DistributedCircuit\n",
    "from skrf import Frequency\n",
    "\n",
    "from ipywidgets import interact\n",
    "\n",
    "# define a frequency object \n",
    "freq = Frequency(0,10,1001,'ghz')\n",
    "\n",
    "# create a Media object for RG-58, based on distributed ckt values\n",
    "rg58 = DistributedCircuit(frequency = freq,\n",
    "                          C =93.5e-12,#F/m \n",
    "                          I =273e-9,  #H/m\n",
    "                          R =0,#53e-3,   #Ohm/m \n",
    "                          G =0,       #S/m\n",
    "                          )\n",
    "\n",
    "\n",
    "load = rg58.load(.5)\n",
    "def func(d1=180,d2=180):\n",
    "    l1 =rg58.line(d=d1,unit='deg')\n",
    "    l2 =rg58.shunt_delay_open(d=d2,unit='deg')\n",
    "    ntwk = l2**l1**load\n",
    "    ntwk.plot_s_smith(0,0)\n",
    "    draw()\n",
    "    show()\n",
    "    \n",
    "a=interact(func, d1= (0,360,10),d2= (0,360,10),embed=True);"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "anaconda-cloud": {},
  "kernelspec": {
   "display_name": "Python [conda env:py35]",
   "language": "python",
   "name": "conda-env-py35-py"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.5.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
